package com.czz.portal.controller;

import com.czz.common.vo.R;
import com.czz.portal.service.CategoryService;
import com.czz.portal.vo.SideBarVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: SideBarController
 * @Author Czz
 * @Date 2020/2/3
 * @Time 10:58
 **/
@RestController
@RequestMapping(value = "/sidebar")
public class SidebarController {

    @Autowired
    CategoryService categoryService;

    /**
    * @Description 获取首页侧边栏
    * @Param []
    * @Return com.czz.common.vo.R
    * @Author Czz
    * @Date 2020/2/6
    * @Time 13:31
    **/
    @GetMapping(value = "")
    public R getSideBar(){
        List<SideBarVo> sideBarVoList = categoryService.getCategorySideBar();
        return R.ok().data("items",sideBarVoList);
    }

}
